package com.chapter03;

import com.bdqn.util.JDBCUtils;

public class Test07_TestUpdate {
    public static void main(String[] args) {
        delete();
    }

    public static void insert() {
        String sql = "insert into grade VALUES(?,?);";
        int i = JDBCUtils.update(sql, 104, "不知道");
        if (i > 0) {
            System.out.println("插入成功");
        }
    }

    public static void update() {
        String sql = "UPDATE grade SET GradeName = ? WHERE GradeId = ?;";
        int i = JDBCUtils.update(sql, "aa", 104);
        if (i > 0) {
            System.out.println("修改成功");
        }
    }

    public static void delete() {
        String sql = "DELETE FROM grade WHERE GradeId = ?;";
        int i = JDBCUtils.update(sql,  104);
        if (i > 0) {
            System.out.println("删除成功");
        }
    }
}
